package com.example.carefree_server.service.impl.i_managerImpl;

import com.example.carefree_server.entity.Department;
import com.example.carefree_server.mapper.m_managerMapper.DepartmentMapper;
import com.example.carefree_server.service.s_managerService.departmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class departmentServiceImpl implements departmentService {

    @Autowired
    private DepartmentMapper departmentMapper;

    @Override
    public List<Department> getAllDepartments() {
        return departmentMapper.getAllDepartments();
    }

    @Override
    public Department findDepartmentById(String did) {
        return departmentMapper.findDepartmentById(did);
    }

    @Override
    public Department insertDepartment(Department department) {
        departmentMapper.insertDepartment(department);
        return department;
    }

    @Override
    public Department updateDepartment(Department department) {
        departmentMapper.updateDepartment(department);
        return department;
    }

    @Override
    public void deleteDepartment(String did) {
        departmentMapper.deleteDepartment(did);
    }
}
